package tools.clustering.isodata.workStrategies;

import java.util.ArrayList;

import tools.utils.DoubleMatrix;

import neuro.uu.se.utils.WorkStrategy;

public class DistanceHistogram implements WorkStrategy {

	/**
	 * takes an arraylist with two isodata_data at index 0 and 1 and a Double binsize at index 2
	 */
	public Object perform(Object object) throws Exception {
		ArrayList list=(ArrayList) object;
		return new Integer((int)Math.floor(((DoubleMatrix)list.get(0)).euclidianLengthFromRowTo(0, ((DoubleMatrix)list.get(1)))/((Double)list.get(2)).doubleValue()));
	}

}
